﻿CREATE PROCEDURE [dbo].[ReportProjectsWithInvalidManagers]
AS
BEGIN
select p.Name as ProjectName, u.FullName
from Projects p inner join
	 Users u on p.ManagerUserID = u.UserID
where (p.StatusID = 1) and ((u.IsActive = 0) or ((u.RoleID <> 1) and (u.RoleID <> 2))) --Active projects with managers that are not active or not an Admin/PM
END